#!/bin/bash

flagfile=/tmp/notifydone

function do_check_snaky() {
	pidof snaky
	ret=$?
	if [ $ret -gt 0 ]; then
		[ ! -f /tmp/$flagfile ] && {
			echo "`date +%Y%m%s%H%M%S`: snaky is missing" >> /tmp/event.log
			touch /tmp/flagfile
		}
	else
		[ -f /tmp/flagfile ] && rm -f /tmp/flagfile
	fi
}
do_check_snaky
